/**
 * 全局路由配置
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)  

const routes = [
  { path: '/', name: 'PlanetIndex',component: () => import('@/components/pages/Index'),
      // redirect: '/loopPic',
      children:[      
          { path: '/planetTest',name: 'PlanetTest', component: () => import('../components/views/PlanetTest.vue') },
          { path: '/helloWorld',name: 'HelloWorld', component: () => import('../components/views/HelloWorld.vue'),props: true },
      ]
  },
  // 其他组件
  {path: '/orderMonitorList',name: 'OrderMonitorList', component: ()=> import('@/components/views/OrderMonitorList.vue')}, 

]

//路由守卫
// router.beforeEach((to, from, next) => {
//     if(to.name === 'FreePlanetIndex' || to.name === 'PlanetLoginRegister'){
//         next()
//     }else{
//         if(isLogin()){
//             next()
//         }else{
//             next({name: 'PlanetLoginRegister'})
//         }
//     }
// })
const router = new VueRouter({routes})
export default router